package com.aaa.dao;

import com.aaa.pojo.Invest;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface InvestMapper {
    //查询
    @Select("select * from investment_horizon")
    List<Invest> selectInvest();
    //添加
    @Insert("insert into investment_horizon(h_deadline,h_day) VALUES (#{h_deadline},#{h_day})")
    boolean insertInvest(Invest invest);
//    根据时间查询
    @Select("select * FROM investment_horizon where h_deadline=#{h_deadline}")
    Invest selectDate(String date);
}
